package com.itmayiedu.JDBCutil.MyJDBC.Jdbcimpl;

import com.itmayiedu.JDBCutil.GetAnnotation;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.concurrent.ConcurrentHashMap;

public class Myparameters {
    private Object[] args;
    private Method method;

    public Myparameters(Method method, Object[] args) {
        this.args=args;
        this.method=method;
    }

    public ConcurrentHashMap<Object, Object> getObjectObjectConcurrentHashMap() {
        ConcurrentHashMap<Object,Object> map=new ConcurrentHashMap<>();
        Parameter[] parameters = method.getParameters();
        try {
            for (int i = 0; i < parameters.length; i++) {
                map.put(GetAnnotation.get1(parameters[i]),args[i]);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return map;
    }
}
